Skip to content

Fix uuid issue in Lutron#110524

Merged
edenhaus merged 5 commits into
home-assistant:devfrom
wilburCforce:lutronNaming
Feb 19, 2024
Merged

Fix uuid issue in Lutron#110524
edenhaus merged 5 commits into
home-assistant:devfrom
wilburCforce:lutronNaming

Conversation

@wilburCforce
Copy link
Copy Markdown
Contributor

@wilburCforce wilburCforce commented Feb 14, 2024

Proposed change

This change addresses older systems that do not have a UUID in the main repeater data. In 2024.1 and prior the naming of entities was [area_name]_[lutron device name]. With the introduction of devices, the naming for entities follows the newer HA architecture where the entity gets its name from the device. The friendly name doesn't include the entity name and without the UUID the entities then appear as unknown because there is no ID to link the entity and device. pylutron was updated (0.2.12 and already merged into dev) to include a generated uuid in these cases and this PR leverages this generated uuid for the identifier.

This specific approach was taken to reduce the number of loops and keep the code resident in the init where device discovery and sorting is already taking place. It executes very quickly and in cases where the uuid is present already or is missing altogether executes very little. The additional processing happens only when an end user updates their firmware on the Lutron device to a newer version that then contains the UUID. This code updates the entities and devices accordingly so that the user's automations and such don't break.

Given that a lot of end users rarely update their firmware, it is expected that this code will remain indefinitely as opposed to a deprecation approach. It would be desirable to implement this in a 2024.2.x release as several users have reported issues with the 2024.2 release (noted in the linked issue) which prompted this update.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @cdheiser, mind taking a look at this pull request as it has been labeled with an integration (lutron) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of lutron can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign lutron Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@joostlek joostlek changed the title updates to fix uuid issues Fix uuid issue in Lutron Feb 14, 2024
@wilburCforce wilburCforce marked this pull request as ready for review February 14, 2024 15:31
@edenhaus edenhaus added this to the 2024.2.2 milestone Feb 16, 2024
Comment thread homeassistant/components/lutron/__init__.py Outdated
Comment thread homeassistant/components/lutron/__init__.py
Comment thread homeassistant/components/lutron/__init__.py Outdated
Comment thread homeassistant/components/lutron/__init__.py
@home-assistant home-assistant Bot marked this pull request as draft February 16, 2024 10:02
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@frenck frenck modified the milestones: 2024.2.2, 2024.2.3 Feb 16, 2024
@wilburCforce wilburCforce marked this pull request as ready for review February 16, 2024 19:51
@home-assistant home-assistant Bot requested a review from edenhaus February 16, 2024 19:51
Copy link
Copy Markdown
Member

@edenhaus edenhaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wilburCforce 👍

@edenhaus edenhaus merged commit 88f7200 into home-assistant:dev Feb 19, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants